package com.chmingx.boot.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class IndexController {
    @Autowired
    JdbcTemplate jdbcTemplate;

    @GetMapping("/sql")
    public String queryFromDb() {
        Long along = jdbcTemplate.queryForObject("select count(*) from user", Long.class);
        return along.toString();
    }

}
